<!doctype html><html xmlns="http://www.w3.org/1999/xhtml" id="html">
    <head>
        <title></title>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <base href="<?= base_url(1); ?>" />
        <link type="text/css" href="css/main.css?v=<?= $config['version'] ?>" rel="stylesheet" />
    </head>
    <body>
        <?php include(VIEWPATH . 'common/main_header.php'); ?>
        <div class="datalist"><table id="flexigrid" style="display:none"></table></div>
        <script type="text/javascript">
            $(function() {
                $("#flexigrid").flexigrid($.extend(SG.flexOptions, {
                    url: '<?= site_url('role/log/flexigrid') ?>',
                    colModel: [
                        //{display: '<?= translate('ROLE_LOG_ID') ?>', name: 'id', width: '60', iskey: true},
                        {display: '<?= translate('ADMINISTRATOR') ?>', name: 'username', width: '100', process: formatSearch},
                        {display: '<?= translate('ROLE_LOG_MODULENAME') ?>', name: 'modulename', width: '150', process: formatSearch},
                        {display: '<?= translate('ROLE_LOG_EXTRAMSG') ?>', name: 'extramsg', width: '150', process: formatSearch},
                        {display: '<?= translate('ROLE_LOG_CONTENT') ?>', name: 'content', width: '500'},
                        {display: 'URL', name: 'url', width: '400', process: formatSearch},
                        {display: '<?= translate('ROLE_LOG_TIME') ?>', name: 'createtime', width: '150'},
                        {display: '<?= translate('MANAGE') ?>', name: 'id', width: '100', sortable: false, process: formatOp},
                    ],
                    buttons: [
                        {name: 'delete', displayname: "<?= translate('DEL') ?>", title: "<?= translate('DEL') ?>", bclass: 'delete', onpress: multi},
                        {name: 'clearall', displayname: "<?= translate('ROLE_LOG_CLEARALL') ?>", title: "<?= translate('ROLE_LOG_CLEARALL') ?>", bclass: 'alert clearall', onpress: clearall},
                    ],
                    searchitems: true,
                    sortname: "id",
                    sortorder: "desc",
                    rowhandler: viewdetailhandler
                }));
                SG.admin = $.extend(SG.admin, {
                    del_url: '<?= site_url("role/log/del/") ?>',
                    multi_url: '<?= site_url("role/log/multi/") ?>',
                    table: '{pre}admin_log'
                });

                function clearall(name) {
                    var current = $(".fbutton ." + name);
                    SG.admin.confirm('<?= translate('ROLE_LOG_CLEARALL_TIPS') ?>', 'ask', function() {
                        _multi(name, [0]);
                    }, {}, {}, current);
                }
                function viewdetailhandler(row) {
                    //双击事件
                    $(row).dblclick(function() {
                        $.dialog({id: 'viewdetail', title: '<?= translate('DETAIL') ?>', content: '<table width="100%" border="0" cellspacing="1" cellpadding="0" class="tablegrid tableedit"><tr><td width="80"><?= translate('ADMINISTRATOR') ?>:</td><td style="text-align:left;">' + $("td:eq(2)", $(row)).text() + '</td></tr><tr><td width="80"><?= translate('ROLE_LOG_TITLE') ?>:</td><td style="text-align:left;">' + $("td:eq(3)", $(row)).text() + '</td></tr><tr><td width="80"><?= translate('ROLE_LOG_CONTENT') ?>:</td><td style="word-break:break-all;text-align:left;">' + $("td:eq(4)", $(row)).text() + '</td></tr><tr><td width="80"><?= translate('ROLE_LOG_TIME') ?>:</td><td style="text-align:left;">' + $("td:eq(6)", $(row)).text() + '</td></tr><tr><td width="80">URL:</td><td style="text-align:left;">' + $("td:eq(5)", $(row)).text() + '</td></tr></table>', style: 'no_button', width: 560, height: 360});
                    });
                }
            });
        </script>
    </body>
</html>